package com.example.sell.dataobject;

import com.example.sell.enums.DeleteFlagEnum;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;

/**
 * 类目
 * @author: vince_zww
 * @date: 2020/7/23 23:57
 * @desceription:
 */
@Entity
@DynamicUpdate
@DynamicInsert
@Data
public class ProductCategory {

    /**
     * 类目id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long categoryId;

    /**
     * 类目名称
     */
    private String categoryName;

    /**
     * 类目编号
     */
    private Integer categoryType;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 0：未删除，1：已删除
     */
    private Integer deleteFlag = DeleteFlagEnum.FALSE.getCode();

    public ProductCategory() {
    }

    public ProductCategory(String categoryName, Integer categoryType, Date createTime, Integer deleteFlag) {
        this.categoryName = categoryName;
        this.categoryType = categoryType;
        this.createTime = createTime;
        this.deleteFlag = deleteFlag;
    }
}
